Using the Empty Node nodes

Use the Empty Node nodes to group nodes and to set property values of their child nodes. Empty Node nodes do not have a visual representation, or any functionality other than a transparent background and that they can act as a parent node to other nodes. Empty Node nodes do not have any properties specific only to them.

For example, use Empty Node nodes to:

An Empty Node is a node into which you can put any other node and has these properties:

Empty Node does not have inherent layout characteristics. Empty Node does not resize its child nodes, but places them to a position you specify. The default values of the Layout Height and Layout Width properties of an Empty Node are 0, but it stretches by default to take all the space its child nodes need.

You can use the Horizontal Alignment and Vertical Alignment properties to align the child nodes of an Empty Node only after you specify the Layout Height and Layout Width properties of that Empty Node.

Creating an Empty Node node

To create an Empty Node node:

  1. In the Project press Alt and right-click the node where you want to create an Empty Node node and select either Empty Node 3D, or Empty Node 2D.
    Note that you can create a 3D node only inside 3D nodes, and 2D node only inside 2D nodes.
  2. In the Project add items to the Empty Node node.
    For example, if you created an Empty Node 3D node, add Sphere nodes, if you created an Empty Node 2D node, add Image nodes.
  3. (Optional) In the Project select the Empty Node node, in the Properties click , add and set the property you want all its child nodes to inherit.

Setting the appearance of an Empty Node 2D node

To set the appearance of 2D nodes:

Using the Empty Node 3D node in the API

To create an Empty Node 3D node using the API:

// Create an Empty Node 3D named Empty3D
EmptyNode3DSharedPtr emptyNode = EmptyNode3D::create(domain, "Empty3D");
        
// Create and add a cube to the Empty Node 3D
ModelSharedPtr cube = Model::createCube(domain, "Cube", 1.0f, KanziThemeOrange);
emptyNode->addChild(cube);

For details, see the EmptyNode3D class in the API reference.

Using the Empty Node 2D node in the API

To create an Empty Node 2D node using the API:

// Create an Empty Node 2D named Empty2D
EmptyNode2DSharedPtr empty2D = EmptyNode2D::create(domain, "Empty2D");

// Create and add an Image to the Empty Node 2D
ImageSharedPtr image = Image::create(domain, "Image");
image->setTextureResourceID(ResourceID("DefaultTexture"));
empty2D->addChild(image);

For details, see the EmptyNode2D class in the API reference.

Empty Node property types and messages

For lists of the available property types and messages for the Empty Node nodes, see Empty node 2D and Empty node 3D.

See also

Property system

Property types

Tutorial: Create reflections

Enabling the click gesture for a node using Kanzi Studio